﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Web;
using InformationCenter.SQLHelper;

namespace InformationCenter.Models
{

    public class UserLogin
    {
        /// <summary>
        /// 用户登陆模型
        /// </summary>

        /// <summary>
        /// 用户名
        /// </summary>
        [Display(Name = "用户名", Description = "4-20个字符。")]
        [Required(ErrorMessage = "输入的用户名不能小于四个字符")]
        [StringLength(20, MinimumLength = 4, ErrorMessage = "输入的用户名不能小于四个字符")]
        public string UserName { get; set; }
        /// <summary>
        /// 密码
        /// </summary>
        [Display(Name = "密码", Description = "6-20个字符。")]
        [Required(ErrorMessage = "输入的密码位数为6至20个字符")]
        [StringLength(20, MinimumLength = 6, ErrorMessage = "输入的密码位数为6至20个字符")]
        [DataType(DataType.Password)]
        public string Password { get; set; }
    }

    public class UserInfo 
    {
        [Key]
        public int Id { get; set; }


        [Required]
        [DisplayName("用户名")]
        public string Name { get; set; }


        [Required]
        [DisplayName("密码")]
        public string Password { get; set; }

        [Required]
        [DisplayName("昵称")]
        public string Nickname { get; set; }

        [DisplayName("登录次数")]
        public int Logincount { get; set; }
        [DisplayName("邮件")]
        public string Mail { get; set; }
        [DisplayName("是否锁定")]
        public bool Locked { get; set; }

    }
}